package com.wenlin.userservice.service.impl;

import com.wenlin.userservice.domain.MethodLock;
import com.wenlin.userservice.mapper.MethodLockMapper;
import com.wenlin.userservice.service.MethodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/***
 *  Created with IntelliJ IDEA.
 *  Author:  wenlin
 *  Date:  2018/3/29 13:52
 *  Description:
 **/
@Service
public class MethodServiceImpl implements MethodService{
    @Autowired
    private MethodLockMapper methodLockMapper;
    @Override
    @Transactional
    public MethodLock getLcok(Integer id) {
        MethodLock methodLock=methodLockMapper.selectByPrimaryKey(id);
        try {
            Thread.sleep(20000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return methodLock;
    }
}
